Repository navigation
Show the Charge Point sessions tooltip again after the move to ECharts - #2829
Conversation
A line series only answers hover through its symbols, which carry the data index the item tooltip needs. The session bars were bare 2-point lines whose invisible hit-area series had no symbols and a disabled tooltip, so nothing ever fired on hover, and the redirect that was meant to cover for it never ran. The hit-area series now has large invisible symbols and its own tooltip, and sits above the visible line, which would otherwise be the element under the cursor. The redirect is gone. The new test drives the real ECharts library with mouse events, which the formatter-only test could not. Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Documentation build overview
9 files changed ·
|
The ruler is linked across subplots, so ECharts also reports the points of the other subplots at the ruler's time. The formatter picked the nearest of all of them, so hovering empty space in one subplot could show another subplot's point. It now ignores every point outside the subplot the pointer is in. Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Each session now has one invisible hit rectangle spanning its earliest to its latest timestamp, drawn by a custom series in pixel space, instead of a row of symbols spaced in time that left gaps once zoomed in. Its tooltip lists all of the session's timestamps. Zooming also no longer drops the points outside the window on this chart, which made a session vanish when zoomed into its middle. Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
Flix6x
left a comment
There was a problem hiding this comment.
Thanks, this works well: hovering anywhere on a session now shows the full tooltip, also when zoomed far in, and the subplot scoping holds up for taps too. I ran the JS tests with the vendored ECharts (all 22 pass, none skipped), and both new tests fail against main's fast-chart.js, so they catch the bug. A nice side effect: the legend colours now match the session bars (on main, Charger 5 was green in the legend but orange in the chart).
Two behaviour regressions are inline, plus the changelog placement and some nits.
This review was drafted with Claude, which tested the PR against the real chart in headless Chrome. If any of the suggestions look off to you, ping me and we'll discuss.
Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
…ons survive The 'none' filter mode kept every point on zoom, which stopped the companion subplots' y-axes rescaling to the visible data. weakFilter keeps that rescaling, and keeps a session segment whose two ends are both out of view because each of its points now carries both ends of the segment as x-dimensions. The session lines are native line series again, so the legend's hover highlight and dimming work as they did. Also: define the hit height before its use, and tidy the new tests (one convertToPixel call, a shared ECharts loader). Signed-off-by: Ahmad-Wahid <ahmedwahid16101@gmail.com>
|
Thanks for the thorough review, Felix. All points are addressed in 844a911 and ac707b6 (plus a merge of main, no rebase). Zoom regression. Right, Legend highlight. Restored with your Changelog. Merged main and moved the entry to v1.2.0 Bugfixes. Nits. A new test, Not covered: the drag-to-zoom (marquee) tool also uses |
The ruler highlights the point nearest in time on every linked subplot, and in the sessions subplot that is often a point of another charger's session, which then thickened while the hovered session stayed as it was. The sessions axis no longer lets its ruler highlight anything; hover over a session is answered by the session's own hit area. The ruler on the companion subplots still highlights their points. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DWv6v4u9asHS25hW25jdvV Signed-off-by: F.N. Claessen <felix@seita.nl>
|
Thanks @Ahmad-Wahid, all points are addressed. I re-checked them in a browser against the real chart: the power axis rescales on zoom again (0–35 instead of 0–1000), sessions survive a mid-session zoom, and legend hover highlights and dims as before. While re-checking, I found one more glitch and pushed a fix myself in 03cdb91, to save a round trip. Hovering a Charger 4 session thickened a Charger 5 bar. The ruler highlights the point nearest in time on every linked subplot, and in the sessions subplot that is often another charger's session. This was already the case on main (worse there: it also faded the hovered charger out), and it only became visible here once the legend emphasis came back. The fix sets Found and fixed with Claude. If you see a problem with it, ping me. |
Flix6x
left a comment
There was a problem hiding this comment.
Approved, with my fix for the cross-charger highlight on top (see above).
Signed-off-by: F.N. Claessen <felix@seita.nl>
Closes #2828.
Problem
Hovering a session bar in the Charge Points chart showed no tooltip since the switch to ECharts.
A line series only answers hover through its symbols, which carry the data index the item tooltip needs.
The session bars were bare 2-point lines, and their invisible hit-area series had no symbols and a disabled tooltip, so no hover event ever fired.
The redirect meant to cover for that never ran.
Fix
wireSessionTooltipRedirect.Tests
test_hovering_a_session_bar_shows_its_tooltipdrives the real ECharts library with mouse events on two bar layers; it fails without the fix.Looks like: